package com.kili.picture.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Jar
 * @Date 2019/4/2
 */
@Configuration
public class AppWebMvcConfigurer implements WebMvcConfigurer {

    @Value("${file.tempPath}")
    private String tempPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/tmp/**").addResourceLocations("file:" + tempPath);
    }

}
